<!DOCTYPE html>
<html>
<head>
  
    <link rel="stylesheet" type="text/css" href="__ADMIN__/Css/bootstrap.min.css" />
     <link rel="stylesheet" type="text/css" href="__ADMIN__/Css/ui.css" />
      <link rel="stylesheet" type="text/css" href="__ADMIN__/Css/Admin-default.css" />
      <js href="/Public/Plugins/jquery/jquery-2.1.1.min.js" />
       <js href="/Public/Plugins/jquery/jquery-ui.js" />
   <js href="/Public/Plugins/bootstrap/bootstrap-datepicker.js" />
        <js href="/Public/Plugins/bootstrap/bootstrap.js" />
        <js href="/Public/Plugins/bootstrap/bootstrap-select.js" />
        <js href="/Public/Plugins/ui-frame/plugins.js" />
        <js href="/Public/Plugins/ui-frame/actions.js" />
        <js href="/Public/Plugins/dropzone/dropzone.js" />
        <js href="/Public/Plugins/knob/knob.js" />
        <script type="text/javascript" src="/Public/Js/ueditor/lang/zh-cn/zh-cn.js"></script>
  <script type="text/javascript" src="/Public/Js/ueditor/ueditor.config.js"></script>
   <script type="text/javascript" src="/Public/Js/ueditor/ueditor.all.min.js"></script>
</head>
<body>
<div class="page-content-wrap" style="height: 670px;">
                    <div class="row">
                        <div class="col-md-12">
                            <div class="panel panel-default">
                                <div class="panel-body">
<form action="{:U('topic/add')}" enctype="multipart/form-data" method="post" class="form-horizontal">
 <input type="hidden" name="id" value="{$id}">
    <div class="form-group">
        <label class="col-md-3 col-xs-12 control-label"></label>
        <div class="col-md-6 col-xs-12">
            <h2>添加话题</h2>
        </div>
    </div>

   
    
        <div class="form-group">
        <label class="col-md-3 col-xs-12 control-label">话题种类</label>
        <div class="col-md-6 col-xs-12">                                                                                            
            <select name="class" class="form-control select"">
            <volist name="class" id="vo">
                <option value="{$vo.id}">{$vo.name}</option>
                </volist>
            </select>
        </div>
      
    </div>
    
    <div class="form-group">
        <label class="col-md-3 col-xs-12 control-label">是否发布话题</label>
        <div class="col-md-6 col-xs-12">                                                                                            
            <select name="ispub" class="form-control select">
                <option value="0" <eq name="info.ispub" value="0">selected="selected"</eq> >不发布</option>
                <option value="1" <eq name="info.ispub" value="1">selected="selected"</eq> >发布</option>
            </select>
        </div>
       
    </div>

    <div class="form-group">
        <label class="col-md-3 col-xs-12 control-label">话题名称</label>
        <div class="col-md-6 col-xs-12">                                            
            <input name="title" type="text" class="form-control" value="{$name}" />
        </div>
    </div>
    
     <div class="form-group">
        <label class="col-md-3 col-xs-12 control-label">图片</label>
        <div class="col-md-6 col-xs-12">                                            
           <input type="file" name="pic" class="form-control"/>
        </div>
    </div>
    
    <div class="form-group" id="article" style="display:block;">
        <label class="col-md-3 col-xs-12 control-label">话题内容</label>
        <div class="col-md-6 col-xs-12">                                            
            <script id="editor" name="content" type="text/plain" style="width:590px;height:360px;">{$info['act_intro']|htmlspecialchars_decode}</script>
        </div>
    </div>
    
     <div class="form-group" id="question" style="display:none;">
        <label class="col-md-3 col-xs-12 control-label">问卷描述</label>
        <div class="col-md-6 col-xs-12">                                            
            <textarea name="description" class="form-control" rows="10">{$description}</textarea>
        </div>
    </div>
    
     
  
    <div>
        <div class="col-md-3 col-xs-12"></div>
        <div class="col-md-6 col-xs-12">
            <present name="errorNote">
                <div class="alert alert-danger" role="alert">
                    <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    <strong>{$errorNote}</strong>
                </div>                        
            </present>
            <div class="form-group">
                <div class="col-md-6"><input type="reset" class="btn btn-block btn-default" value=" 清 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 空 " /></div>
                <div class="col-md-6"><button class="btn btn-block btn-info pull-right"> 提 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 交 </button></div>
            </div>
        </div>
    </div>

</form>
</div>
</div>
</div>
</div>
</div>

<script type="text/javascript">
function t(obj)
{
	if(obj.value=="0")
		{
			document.getElementById("question").style.display="none";//隐藏
		　　document.getElementById("article").style.display="block";//显示
		}
	else {
			document.getElementById("article").style.display="none";//隐藏
		　　document.getElementById("question").style.display="block";//显示
		}
}
</script>
<script type="text/javascript">

    //实例化编辑器
    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
    UE.getEditor('editor');


    function isFocus(e){
        alert(UE.getEditor('editor').isFocus());
        UE.dom.domUtils.preventDefault(e)
    }
    function setblur(e){
        UE.getEditor('editor').blur();
        UE.dom.domUtils.preventDefault(e)
    }
    function insertHtml() {
        var value = prompt('插入html代码', '');
        UE.getEditor('editor').execCommand('insertHtml', value)
    }
    function createEditor() {
        enableBtn();
        UE.getEditor('editor');
    }
    function getAllHtml() {
        alert(UE.getEditor('editor').getAllHtml())
    }
    function getContent() {
        var arr = [];
        arr.push("使用editor.getContent()方法可以获得编辑器的内容");
        arr.push("内容为：");
        arr.push(UE.getEditor('editor').getContent());
        alert(arr.join("\n"));
    }
    function getPlainTxt() {
        var arr = [];
        arr.push("使用editor.getPlainTxt()方法可以获得编辑器的带格式的纯文本内容");
        arr.push("内容为：");
        arr.push(UE.getEditor('editor').getPlainTxt());
        alert(arr.join('\n'))
    }
    function setContent(isAppendTo) {
        var arr = [];
        arr.push("使用editor.setContent('欢迎使用ueditor')方法可以设置编辑器的内容");
        UE.getEditor('editor').setContent('欢迎使用ueditor', isAppendTo);
        alert(arr.join("\n"));
    }
    function setDisabled() {
        UE.getEditor('editor').setDisabled('fullscreen');
        disableBtn("enable");
    }

    function setEnabled() {
        UE.getEditor('editor').setEnabled();
        enableBtn();
    }

    function getText() {
        //当你点击按钮时编辑区域已经失去了焦点，如果直接用getText将不会得到内容，所以要在选回来，然后取得内容
        var range = UE.getEditor('editor').selection.getRange();
        range.select();
        var txt = UE.getEditor('editor').selection.getText();
        alert(txt)
    }

    function getContentTxt() {
        var arr = [];
        arr.push("使用editor.getContentTxt()方法可以获得编辑器的纯文本内容");
        arr.push("编辑器的纯文本内容为：");
        arr.push(UE.getEditor('editor').getContentTxt());
        alert(arr.join("\n"));
    }
    function hasContent() {
        var arr = [];
        arr.push("使用editor.hasContents()方法判断编辑器里是否有内容");
        arr.push("判断结果为：");
        arr.push(UE.getEditor('editor').hasContents());
        alert(arr.join("\n"));
    }
    function setFocus() {
        UE.getEditor('editor').focus();
    }
    function deleteEditor() {
        disableBtn();
        UE.getEditor('editor').destroy();
    }
    function disableBtn(str) {
        var div = document.getElementById('btns');
        var btns = domUtils.getElementsByTagName(div, "button");
        for (var i = 0, btn; btn = btns[i++];) {
            if (btn.id == str) {
                domUtils.removeAttributes(btn, ["disabled"]);
            } else {
                btn.setAttribute("disabled", "true");
            }
        }
    }
    function enableBtn() {
        var div = document.getElementById('btns');
        var btns = domUtils.getElementsByTagName(div, "button");
        for (var i = 0, btn; btn = btns[i++];) {
            domUtils.removeAttributes(btn, ["disabled"]);
        }
    }

    function getLocalData () {
        alert(UE.getEditor('editor').execCommand( "getlocaldata" ));
    }

    function clearLocalData () {
        UE.getEditor('editor').execCommand( "clearlocaldata" );
        alert("已清空草稿箱")
    }

</script>

</body>
</html>